﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ArduinoAnalyzer.Tokens.LexicalAnalysis
{
    public class Token
    {
        #region Constructors

        public Token(TokenType type, string lexeme)
        {
            _type = type;
            _lexeme = lexeme;
        }

        #endregion

        #region Attributes and Properties

        private TokenType _type;
        public TokenType Type
        {
            get { return _type; }
            set { _type = value; }
        }

        private string _lexeme;
        public string Lexeme
        {
            get { return _lexeme; }
            set { _lexeme = value; }
        }

        private int _position;
        public int Position
        {
            get { return _position; }
            set { _position = value; }
        }

        private int _line;
        public int Line
        {
            get { return _line; }
            set { _line = value; }
        }

        private int _column;
        public int Column
        {
            get { return _column; }
            set { _column = value; }
        }

        #endregion

        #region Overriden Methods

        public override string ToString()
        {
            return string.Format("({0},{1}) {2} \"{3}\"", _line, _column, _type.ToString(), _lexeme);
        }

        #endregion
    }
}
